/**
 * @file
 * @author  Tsin Smith <tsin.creator@gmail.com>
 *
 */

#ifndef __TSIN_CONFIG_CONFIG_HPP__
#define __TSIN_CONFIG_CONFIG_HPP__

#include <tsin/config/common.hpp>
#include <tsin/util/Resolution.hpp>

namespace tsin {

        /**
         * @class Config
         * @ingroup config
         * @brief Configurations of the game.
         *
         * Initialized with default values.
         */
        class CONFIG_DLLEXPORT Config
        {
        public:
                virtual ~Config() {}

                /**
                 * @name Display Parameters
                 */
                //@{
                /**
                 * Width of the screen.
                 */
                int width;

                /**
                 * Height of the screen.
                 */
                int height;

                /**
                 * Whether the game is run in fullscreen mode.
                 */
                bool fullscreen;

                /**
                 * Frames per second. With the minimum of 1 and maximum of 60.
                 */
                int fps;

                /**
                 * Bits per pixel. Use the default at most time.
                 */
                int bpp;

                /**
                 * Resolution for internal coordinates.
                 */
                StandardResolution resolution;

                //@}

                /**
                 * @name Config Selector Parameters
                 */
                //@{
                /**
                 * Default file to open for config selector.
                 */
                char *file;
                //@} Config Selector Parameters

                /**
                 * Initialize the fields with default values.
                 */
                Config();

                /**
                 * Write current configurations to the storage if exists.
                 *
                 * @return 0 on success and a negative value otherwise.
                 */
                virtual int writeConfig();
        };

}

#endif /* __TSIN_CONFIG_CONFIG_HPP__ */
